Period mapping method and network device

ABSTRACT

Embodiments of this application provide a period mapping method and a network device. The method includes: receiving, by a downstream first network device, first information sent by an upstream second network device, where the first information carries a number of the 1st period of the second network device, the number is referred to as a first number, and the first number includes a first label number and a first group number; and establishing, by the first network device, mapping relationships between numbers of a plurality of periods of the first network device and numbers of a plurality of periods of the second network device based on a mapping relationship between a second label number and a second group number that are included in a number of a first period that can be used to send the first information and a first label number and a first group number.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2019/099296, filed on Aug. 5, 2019, which claims priority toChinese Patent Application No. 201810983768.3, filed on Aug. 27, 2018.The disclosures of the aforementioned applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the communications field, and morespecifically, to a period mapping method and a network device.

BACKGROUND

Deterministic networking is a hotspot currently discussed in theindustry, and a core of the deterministic networking is to ensure anend-to-end bandwidth, delay, and jitter of a service flow.Scale-extensible data-plane deterministic packet scheduling needs to beimplemented to meet an end-to-end deterministic jitter of a packet.

In a packet scheduling method provided in the prior art, a uniformjitter is set for an entire network. However, if a uniform jitter isstill set for the entire network when architectures of packet schedulingbetween all network devices in the entire network are inconsistent,packet scheduling timeliness is affected. Therefore, when architecturesof packet scheduling between all network devices in an entire networkare inconsistent, how to establish mapping relationships between periodsof different network devices in the network to improve packet schedulingtimeliness is a problem urgently needing to be resolved.

SUMMARY

This application provides a period mapping method and a network device,to establish a mapping relationship between periods of different networkdevices, to improve packet scheduling timeliness.

According to a first aspect, a period mapping method is provided, andincludes: receiving, by a first network device, first information sentby a second network device, where the first information carries a firstnumber, the first number is a number of the 1^(st) period of the secondnetwork device, and the first number includes a first label number and afirst group number; determining, by the first network device, a firstperiod that can be used to send the first information, where a secondnumber of the first period includes a second label number and a secondgroup number, and the first label number and the first group number meeta mapping relationship with the second label number and the second groupnumber; and establishing, by the first network device, mappingrelationships between numbers of a plurality of periods of the firstnetwork device and numbers of a plurality of periods of the secondnetwork device based on the mapping relationship.

Optionally, the first network device and the second network devicebelong to different forwarding architectures, and the forwardingarchitectures correspond to different jitters; or the first networkdevice and the second network device belong to a same forwardingarchitecture, but a jitter of the first network device is inconsistentwith a jitter of the second network device due to another reason.

The first network device is a downstream device of the second networkdevice in a network.

According to the period mapping method in this embodiment of thisapplication, the first information carries the first number of the1^(st) period of the second network device, so that the first networkdevice establishes the mapping relationships between the numbers of theplurality of periods of the first network device and the numbers of theplurality of periods of the second network device based on the mappingrelationship between the first number of the 1^(st) period and thesecond number of the first period that can be used to send the firstinformation.

Specifically, because the jitter of the first network device isinconsistent with the jitter of the second network device, the number ofthe 1^(st) period includes the first label number and the first groupnumber, and the second number includes the second label number and thesecond group number, so that the mapping relationships are successfullyestablished.

With reference to the first aspect, in some implementations of the firstaspect, the determining, by the first network device, a first periodthat can be used to send the first information includes: determining, bythe first network device based on a first moment and a first jitterjitter, the first period that can be used to send the first information,where the first moment is a moment at which the first network devicereceives the first information, and the first jitter is a jitter of thefirst network device.

According to the period mapping method in this embodiment of thisapplication, the first network device can determine, based on thereceived first information and the jitter of the first network device,the first period that can be used to send the first information.

With reference to the first aspect, in some implementations of the firstaspect, before the receiving, by a first network device, firstinformation sent by a second network device, the method furtherincludes: determining, by the first network device, m based on the firstjitter jitter, where m is a quantity of label numbers used to identifythe periods of the first network device, and the first jitter is thejitter of the first network device; receiving, by the first networkdevice, second information sent by the second network device, where thesecond information indicates n, n is a quantity of label numbers used toidentify the periods of the second network device, and m and n arepositive integers; and numbering, by the first network device, eachperiod of the first network device based on m and n.

According to the period mapping method in this embodiment of thisapplication, the first network device can determine, based on the jitterof the first network device, the quantity m of the label numbers used toidentify the periods of the first network device, and number each periodof the first network device based on m and the quantity n of the labelnumbers used to identify the periods of the second network device, toprovide a new numbering manner when the jitter of the first networkdevice is inconsistent with the jitter of the second network device.

With reference to the first aspect, in some implementations of the firstaspect, the numbering, by the first network device, each period of thefirst network device based on m and n includes: calculating, by thefirst network device, a least common multiple L of m and n; determining,by the first network device based on L and m, a quantity x of groupsinto which the periods of the first network device can be divided; andnumbering, by the first network device, each period of the first networkdevice based on m and x, where the number of each period of the firstnetwork device includes a label number and a group number.

According to the period mapping method in this embodiment of thisapplication, the first network device can determine, based on m and theleast common multiple L of m and n, a quantity of groups into which allperiods in one super frame of the first network device can be divided,where one super frame includes L periods in total, so that the quantityof periods in one super frame of the first network device is the same asa quantity of periods in one super frame of the second network device,facilitating establishment of the mapping relationships between theperiods.

It should be understood that in this application, the least commonmultiple L of m and n is selected as the quantity of periods in onesuper frame, to improve period mapping performance. Actually, thequantity of periods included in the super frame only needs to be acommon multiple of m and n.

With reference to the first aspect, in some implementations of the firstaspect, the quantity of groups is x=L/m, and each group in the x groupsof periods includes m periods.

According to the period mapping method in this embodiment of thisapplication, L periods of the first network device are divided into xgroups, and each group includes m periods, so that the periods of thefirst network device are in one-to-one correspondence to the periods ofthe second network device.

With reference to the first aspect, in some implementations of the firstaspect, the method further includes: sending, by the first networkdevice, third information to the second network device, where the thirdinformation indicates m, and m is used to support the second networkdevice in numbering each period of the second network device.

According to the period mapping method in this embodiment of thisapplication, the first network device sends the third information to thesecond network device, to indicate m, so that the second network devicecan number each period of the second network device.

With reference to the first aspect, in some implementations of the firstaspect, that the first information carries the first number includes: pbits of the first information are used to indicate a value of the firstlabel number; and q bits of the first information are used to indicate avalue of the first group number, where p and q are positive integers.

According to the period mapping method in this embodiment of thisapplication, bit values of the first information are used to indicatethe value of the first label number and the value of the first groupnumber, so that the value of the first label number and the value of thefirst group number can be indicated explicitly.

According to a second aspect, a period mapping method is provided, andincludes: determining, by a second network device, a first number, wherethe first number is a number of the 1^(st) period of the second networkdevice, and the first number includes a first label number and a firstgroup number; and sending, by the second network device, firstinformation to a first network device, where the first informationcarries the first number, and the first information is used to supportthe first network device in establishing mapping relationships betweennumbers of a plurality of periods of the first network device andnumbers of a plurality of periods of the second network device.

According to the period mapping method in this embodiment of thisapplication, in order that a downstream device can establish mappingrelationships between periods of an upstream device and periods of adownstream device, when a jitter of the first network device isinconsistent with a jitter of the second network device, the secondnetwork device sends the first information to the first network device,and adds the first number of the 1^(st) period of the second networkdevice to the first information, so that the first network deviceestablishes the mapping relationships between the numbers of theplurality of periods of the first network device and the numbers of theplurality of periods of the second network device based on the firstnumber of the 1^(st) period and a second number of a first period thatcan be used to send the first information.

Specifically, the number of the 1^(st) period includes the first labelnumber and the first group number, and the second number includes asecond label number and a second group number, so that the mappingrelationships are successfully established.

With reference to the second aspect, in some implementations of thesecond aspect, the determining, by a second network device, a firstnumber includes: determining, by the second network device, n based on asecond jitter jitter, where n is a quantity of label numbers used toidentify the periods of the second network device, and the second jitteris a jitter of the second network device; receiving, by the secondnetwork device, third information sent by the first network device,where the third information indicates m, m is a quantity of labelnumbers used to identify the periods of the first network device, and mand n are positive integers; and numbering, by the second networkdevice, each period of the second network device based on m and n, anddetermining the first number.

According to the period mapping method in this embodiment of thisapplication, the second network device can determine, based on thejitter of the second network device, the quantity n of the label numbersused to identify the periods of the second network device, and numbereach period of the second network device based on n and the quantity mof the label numbers used to identify the periods of the first networkdevice, to provide a new numbering manner when the jitter of the firstnetwork device is inconsistent with the jitter of the second networkdevice.

With reference to the second aspect, in some implementations of thesecond aspect, the numbering, by the second network device, each periodof the second network device based on m and n includes: calculating, bythe second network device, a least common multiple L of m and n;determining, by the second network device based on L and n, a quantity yof groups into which the periods of the second network device can bedivided; and numbering, by the second network device, each period of thesecond network device based on n and y, where the number of each periodof the second network device includes a label number and a group number.

According to the period mapping method in this embodiment of thisapplication, the second network device can determine, based on n and theleast common multiple L of m and n, a quantity of groups into which allperiods in one super frame of the second network device can be divided,where one super frame includes L periods in total, so that a quantity ofperiods in one super frame of the first network device is the same asthe quantity of periods in one super frame of the second network device,facilitating establishment of the mapping relationships between theperiods.

It should be understood that in this application, the least commonmultiple L of m and n is selected as the quantity of periods in onesuper frame, to improve period mapping performance. Actually, thequantity of periods included in the super frame only needs to be acommon multiple of m and n.

With reference to the second aspect, in some implementations of thesecond aspect, the quantity of groups is y=L/n, and each group in theygroups of periods includes n periods.

According to the period mapping method in this embodiment of thisapplication, L periods of the second network device are divided into ygroups, and each group includes n periods, so that the periods in onesuper frame of the first network device are in one-to-one correspondenceto the periods in one super frame of the second network device.

With reference to the second aspect, in some implementations of thesecond aspect, the method further includes: sending, by the secondnetwork device, second information to the first network device, wherethe second information indicates n, and n is used to support the firstnetwork device in numbering each period of the first network device.

According to the period mapping method in this embodiment of thisapplication, the second network device sends the second information tothe first network device, to indicate n, so that the first networkdevice can number each period of the first network device.

With reference to the second aspect, in some implementations of thesecond aspect, that the first information carries the first numberincludes: p bits of the first information are used to indicate a valueof the first label number; and q bits of the first information are usedto indicate a value of the first group number, where p and q arepositive integers.

According to the period mapping method in this embodiment of thisapplication, bit values of the first information are used to indicatethe value of the first label number and the value of the first groupnumber, so that the value of the first label number and the value of thefirst group number can be indicated explicitly.

According to a third aspect, a first network device is provided. Thefirst network device is configured to perform the period mapping methodin the first aspect or any possible implementation of the first aspect.

Specifically, the first network device may include units configured toperform the period mapping method in the first aspect or any possibleimplementation of the first aspect.

According to a fourth aspect, a first network device is provided. Thefirst network device includes a processor and a transceiver. Theprocessor communicates with the transceiver by using an internalconnection path.

Optionally, the first network device further includes a memory. Thememory is configured to store an instruction, and the processor isconfigured to execute the instruction stored in the memory.

In an optional implementation, the processor performs the method in thefirst aspect or any possible implementation of the first aspect.

According to a fifth aspect, a computer readable storage medium isprovided, and stores a computer program, where when the program isexecuted by a processor, the method in the first aspect or any possibleimplementation of the first aspect is implemented.

According to a sixth aspect, a computer program product is provided. Thecomputer program product includes computer program code, and when thecomputer program code is run by a communications unit and a processingunit, or a transceiver and a processor of the first network device, thefirst network device is enabled to perform the method in the firstaspect.

According to a seventh aspect, a chip system is provided, and includes aprocessor, configured to support a first network device in implementingthe method in the first aspect. In an optional implementation, theprocessor in the chip system is configured to support the first networkdevice in implementing the method in the fourth aspect.

According to an eighth aspect, a second network device is provided. Thesecond network device is configured to perform the period mapping methodin the second aspect or any possible implementation of the secondaspect.

Specifically, the second network device may include units configured toperform the period mapping method in the second aspect or any possibleimplementation of the second aspect.

According to a ninth aspect, a second network device is provided. Thesecond network device includes a processor and a transceiver. Theprocessor communicates with the transceiver by using an internalconnection path.

Optionally, the second network device further includes a memory. Thememory is configured to store an instruction, and the processor isconfigured to execute the instruction stored in the memory.

In an optional implementation, the processor performs the method in thesecond aspect or any possible implementation of the second aspect.

According to a tenth aspect, a computer readable storage medium isprovided, and stores a computer program, where when the program isexecuted by a processor, the method in the second aspect or any possibleimplementation of the second aspect is implemented.

According to an eleventh aspect, a computer program product is provided.The computer program product includes computer program code, and whenthe computer program is run by a communications unit and a processingunit, or a transceiver and a processor of the second network device, thesecond network device is enabled to perform the method in the secondaspect.

According to a twelfth aspect, a chip system is provided, and includes aprocessor, configured to support a second network device in implementingthe method in the second aspect.

According to a thirteenth aspect, a period mapping system is provided,including one or more of the first network device and the second networkdevice described above.

In a possible design, the period mapping system may further includeanother device that interacts with the first network device and thesecond network device in the solution provided in this embodiment ofthis application, and the like.

According to the period mapping method and the network device that areprovided in the embodiments of this application, the first number of the1^(st) period of the second network device is added to the firstinformation sent by the second network device to the first networkdevice, and when the jitter of the first network device is inconsistentwith the jitter of the second network device, the first number includesthe first label number and the first group number, so that the firstnetwork device can establish mapping relationships between periods ofdifferent network devices, to improve packet scheduling timeliness.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a network 100 to which embodiments ofthis application are applicable;

FIG. 2 is a schematic diagram of packet forwarding according to anembodiment of this application;

FIG. 3 is a schematic diagram of a quantity of period labels accordingto an embodiment of this application;

FIG. 4 is another schematic diagram of a quantity of period labelsaccording to an embodiment of this application;

FIG. 5 is a schematic diagram of packet forwarding in the prior art;

FIG. 6 is a schematic diagram of a period mapping method according to anembodiment of this application;

FIG. 7 is a schematic diagram of a method for numbering, by a secondnetwork device, periods according to an embodiment of this application;

FIG. 8 is a schematic diagram of a method for numbering, by a firstnetwork device, periods according to an embodiment of this application;

FIG. 9 is a schematic diagram of a period mapping according to anembodiment of this application;

FIG. 10 is a schematic diagram of another period mapping according to anembodiment of this application;

FIG. 11 is a schematic diagram of a specific embodiment of thisapplication;

FIG. 12 is a schematic diagram of still another period mapping accordingto an embodiment of this application;

FIG. 13 is a schematic diagram of still another period mapping accordingto an embodiment of this application;

FIG. 14 is a schematic block diagram of a first network device accordingto an embodiment of this application;

FIG. 15 is a schematic block diagram of a second network deviceaccording to an embodiment of this application;

FIG. 16 is another schematic block diagram of a first network deviceaccording to an embodiment of this application; and

FIG. 17 is another schematic block diagram of a second network deviceaccording to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The following describes technical solutions of this application withreference to accompanying drawings.

FIG. 1 is a schematic diagram of a network 100 to which embodiments ofthis application are applicable. The network 100 includes a firstnetwork device, a second network device, and a third network device.

Specifically, the first network device, the second network device, andthe third network device are any three network devices in the network100. Packet forwarding can be performed between the three networkdevices.

Specifically, the three network devices include a downstream networkdevice and an upstream network device. In other words, a packet of theupstream network device can be forwarded to the downstream networkdevice, and is forwarded by the downstream network device.

For example, the first network device is an upstream network device, andthe second network device is a downstream network device of the firstnetwork device. Then, the first network device may send, to the secondnetwork device, a packet needing to be sent, and the second networkdevice forwards the packet.

For example, the third network device is a downstream network device ofthe second network device. The second network device forwards the packetto the third network device, and the third network device forwards thepacket.

Alternatively, both the first network device and the second networkdevice are upstream network devices of the third network device. Then,the first network device and the second network device may send, to thethird network device, packets needing to be sent, and the third networkdevice forwards the packets.

For example, the first network device, the second network device, andthird network device may be routers or other network devices that canforward packets.

It should be understood that this embodiment of this application doesnot limit a quantity of network devices specifically included in thenetwork 100 and an upstream and downstream relationship between networkdevices. FIG. 1 is merely an example, and cannot constitute anylimitation to the protection scope of this application.

It should be further understood that the network 100 in FIG. 1 mayfurther include another network device, or another terminal devicecommunicating with the network devices, and this is not limited in thisapplication.

Further, the network 100 may be deterministic networking. Thedeterministic networking is a hotspot currently discussed in theindustry, and the following briefly describes the deterministicnetworking.

Network models constructed by using a complex system mainly include twonetwork models. One is a network generated in a random manner, and theother is a network constructed in a deterministic manner.

The random network is not applicable to a communication networkincluding fixed node connectivity, and the deterministic networking is anetwork that is constructed in the deterministic manner and thatreflects a real system characteristic.

Specifically, the deterministic networking is required by an industrialinternet, an intelligent plant, a programmable logic controller(programmable logic controller, PLC) remote, cloudification, and thelike, and the deterministic networking is also required by a remotereal-time service such as augmented reality (augmented reality,AR)/virtual reality (virtual reality, VR) real-time interaction, aremote surgery, or tactile internet.

To better understand the technical solutions recorded in the embodimentsof this application, the following first briefly describes several basicconcepts used in this application.

1. Periodic Shaping.

Each flow (flow) entering a network device needs to meet or to form,through shaping, the following mode:

A total quantity of bytes of the flow in each period (T) should notexceed a product of a bandwidth and the period. It is assumed that ani^(th) flow entering the network device is referred to as flow_i, and anaverage bandwidth in a service level agreement (service level agreement,SLA) of the flow_i is bandwidth_i. Then, a total quantity of bytes ofthe flow_i in each T should not exceed bandwidth_i*T.

It should be understood that the period (T) is a uniform period value inthe network, and a value of each period of each network device in thenetwork is T.

For example, the period is T=10 μs, and the bandwidth is 1000 Mbps.Then, a total quantity of bytes that are of any flow and that areallowed to be sent in each period is 1000 Mbps*10 μs=125*10{circumflexover ( )}6 B/s*10{circumflex over ( )}−5 s=1250 B.

2. Periodic Forwarding

A packet sent through an outbound interface of a network device in oneperiod is a sum of packets that are of all traffic carried on theoutbound interface and that are sent in one period.

In other words, the following case does not exist: Traffic of a flow inone period is forwarded by a network device in a plurality of periods,or traffic of a flow in a plurality of periods is forwarded by onenetwork device in one period.

For example, a total quantity of packets sent through an outboundinterface 1 of a network device in a period A is 12500 B, and a flowcarried on the outbound interface 1 includes flow_i (i=1, 2, 3, . . . ,m).

Then, a sum of traffic that is of all flows carried on the outboundinterface 1 and that is in the period A is 12500 B, and may berepresented as:

${\sum\limits_{1}^{m}\left( {{date\_ flow}{\_ i}} \right)},$where date_flow_i indicates traffic of each flow in the period A.

Specifically, periodic forwarding is ensured through period exchange.

3. Period Exchange.

An inbound interface of a network device receives a packet that is in aperiod of an upstream network device, and the packet carries a label ofthe period. The network device searches for an arrival outboundinterface through routing, and maps the packet to one period of thecorresponding outbound interface by using a fixed mapping relationshipbetween a period of the inbound interface and a period of the outboundinterface, to ensure that packets sent through the outbound interface inone period are a sum of packets that are of all traffic carried on theoutbound interface and that are sent in one period.

A period label is identification information that can identify theperiod. The fixed mapping relationship between the period of the inboundinterface and the period of the outbound interface is preset.

For example, the fixed mapping relationship between the period of theinbound interface and the period of the outbound interface is asfollows: A packet that is received through an inbound interface 1 of anetwork device and that carries a period label being a period A is sentin a period B of an outbound interface 1 of the network device.

For example, a sum of packets that are received through the inboundinterface 1 of the network device and that carry period labels being theperiod A is 12500 B.

It should be understood that the received packet carries a label of theperiod A. For example, the label of the period A may be A, and can beused to determine the period A, or a label of the period A may be otheridentification information that can be used to determine the period A.

Further, the network device searches for an outbound interface throughrouting, and determines that an outbound that meets a routingrelationship with the inbound interface 1 is the outbound interface 1.The network device then maps, based on a fixed mapping relationshipbetween the period A and the period B, the received 12500 B packets tothe period B of the outbound interface 1.

Therefore, all the received 12500 B packets are sent in the period B ofthe outbound interface 1.

The foregoing describes a scenario to which this application can beapplied and basic concepts used in the embodiments of this application,and the following briefly describes a basic condition that packetforwarding needs to meet in the application scenario shown in FIG. 1 .

Specifically, a core of deterministic networking is to ensure anend-to-end bandwidth, delay, and jitter of a service flow. A delay inthe deterministic networking may be referred to as a “deterministiclatency”.

The “deterministic latency” means that when a packet meets an unexpectedrequirement, a delay (delay) and a jitter (jitter) of packettransmission meet an upper limit defined in the network. A varying delayis referred to as a jitter, and the jitter is briefly referred to as ajitter below.

Scale-extensible data-plane deterministic packet scheduling needs to beimplemented to meet an end-to-end deterministic jitter of a packet.

Specifically, deterministic packet scheduling involves a label number ofa period of a network device.

The following describes in detail deterministic packet scheduling thatis based on a label number of a period of a network device.

First, a packet is scheduled in a corresponding period based on a labelnumber that is of the period of the network device and that is carriedin the packet. A quantity of bytes that are of a packet and that areallowed to be sent in one period is

$\sum\limits_{1}^{m}{\left( {{date\_ flow}{\_ i}} \right).}$

Second, a period number is obtained through cyclic numbering based on aquantity of label numbers of a plurality of periods.

For example, there are three label numbers of periods. Period numbersmay be 0, 1, 2, 0, 1, 2, . . . ; or may be 1, 2, 3, 1, 2, 3, . . . .

It should be noted that:

1. A quantity of label numbers of periods is very dependent on ahop-by-hop jitter. The quantity of the label numbers of the periods isN=2+(jitter/T).

Specifically, hop by hop is a gating module spacing between an upstreamnetwork device and a downstream network device in the network.

2. An expected end-to-end delay (excluding a line delay) ish*(jitter+1.5T), and h is a quantity of hops (hop) between ends.

End to end means that a packet sent by a network device in the networkarrives at a network device that forwards the packet in the network. Alongest delay of each hop is jitter+2T, and a shortest delay isjitter+T.

For example, a packet sent by the first network device in the network issent by the third network device in the network. First, the firstnetwork device sends the packet to the second network device, and thenthe second network device sends the packet to the third network device.

Then, h=2, and the expected end-to-end delay is 2*(jitter+1.5T).

Packet scheduling performed based on a label number of a period of anetwork device involves a quantity of label numbers of periods. Thefollowing briefly describes the quantity of the label numbers of theperiods with reference to FIG. 2 to FIG. 4 .

FIG. 2 is a schematic diagram of packet forwarding according to anembodiment of this application. The schematic diagram includes a firstnetwork device, a second network device, and a third network device.

For example, both of two upstream network devices (the first networkdevice and the second network device in FIG. 2 ) send packets to onedownstream network device (the third network device in FIG. 2 ), and aprocess is as follows:

First, it should be understood that there is a delay when a packet istransmitted between two neighboring network devices, and a range of thedelay is referred to a jitter.

For example, as shown in FIG. 2 , there is a delay when the firstnetwork device sends a packet A to the third network device, where Δ′ isa shortest delay of sending, by the first network device, a packet tothe third network device, and A is a longest delay of sending, by thefirst network device, a packet to the third network device. Then, ajitter is Δ−Δ′.

For another example, as shown in FIG. 2 , there is a delay when thesecond network device sends a packet B to the third network device,where Δ′ is a shortest delay of sending, by the second network device, apacket to the third network device, and Δ is a longest delay of sending,by the second network device, a packet to the third network device.Then, a jitter is Δ−Δ′.

The jitter existing when the first network device sends the packet tothe third network device is the same as the jitter existing when thesecond network device sends the packet to the third network device, andit may be understood that a uniform jitter is set for the entirenetwork.

It should be further understood that a packet sending network deviceconstantly sends, in a time range, packets to a packet receiving networkdevice.

For example, as shown in FIG. 2 , the first network device sends thepacket A to the third network device, and a sending time range of thepacket A is as follows: A rectangle filled with slashes in FIG. 2represents a sending time range (T1) of a packet in one period of thefirst network device.

It should be understood that the packet A is merely a representation ofa packet sent by the first network device to the third network device,and this application does not limit a constitution of the packet A. Forexample, the packet A may be one packet or may include a plurality ofpackets.

For another example, as shown in FIG. 2 , the second network devicesends the packet B to the third network device, and a sending time rangeof the packet A is as follows: Another rectangle filled with slashes inFIG. 2 represents a sending time range (T2) of a packet in one period ofthe second network device.

It should be understood that the packet B is merely a representation ofa packet sent by the second network device to the third network device,and this application does not limit a constitution of the packet B. Forexample, the packet B may be one packet or may include a plurality ofpackets.

Specifically, when a packet sending network device constantly sendspackets to a packet receiving network device in a time range, the packetreceiving network device constantly receives the packets in a timerange.

For example, as shown in FIG. 2 , when the first network deviceconstantly sends the packet A to the third network device in the timerange T1, considering that there is a shortest delay and a longest delaywhen the first network device sends the packet A to the third networkdevice, a time range in which the third network device receives thepacket A is represented by using a rectangle that is not filled in FIG.2 , and it indicates a time range (T1′) in which the packet A arrives atthe third network device.

For another example, as shown in FIG. 2 , when the second network deviceconstantly sends the packet B to the third network device in the timerange T2, considering that there is a shortest delay and a longest delaywhen the second network device sends the packet B to the third networkdevice, a time range in which the third network device receives thepacket B is indicated by using another rectangle that is not filled inFIG. 2 , and it indicates a time range (T2′) in which the packet Barrives at the third network device.

Further, to ensure that all packets that are in one period and that arereceived by an upstream network device can be sent in one period of adownstream network device, the downstream network device needs toprepare all to-be-sent packets before a start of a sending period of thedownstream network device, or otherwise, there may be a case in which itis too late to perform sending.

For example, it can be learned from FIG. 2 that all packets (referred toas the packet B) in the 5^(th) period (a period that is of the secondnetwork device and whose label number is 4 in FIG. 2 , where the periodmay be referred to as a fourth period) of the second network device aresent to the third network device before a start of the 7^(th) period (aperiod that is of the third network device and whose label number is 6in FIG. 2 , where the period may be referred to as a sixth period) ofthe third network device (as shown in FIG. 2 , a latest arrival momentof the packet B is Tb, which is before the start of the 7^(th) period ofthe third network device). Therefore, after receiving the packet B, thethird network device may send the first packet in the 7^(th) period ofthe third network device.

However, a packet that is the last to arrive at the third network devicein all packets (referred to as the packet A) in the 4^(th) period (aperiod that is of the first network device and whose label number is 3in FIG. 2 , where the period may be referred to as a third period) ofthe first network device may arrive after a start of the 6^(th) period(a period that is of the third network device and whose label number is5 in FIG. 2 , where the period may be referred to as a fifth period) ofthe third network device (as shown in FIG. 2 , a latest arrival momentof the packet A is Ta, which is after the start of the 6^(th) period ofthe third network device).

Therefore, after receiving the packet A, to ensure periodic forwarding,the third network device cannot send the packet A in the 6^(th) periodof the third network device.

The third network device may send the packet A in a next period of the6^(th) period. In other words, the third network device sends the packetA in the 7^(th) period after receiving the packet A.

It can be learned from the foregoing description that an inboundinterface of the third network device receives the packet B, and thethird network device searches for an outbound interface through routing,and then maps the packet B to the 7^(th) period of the third networkdevice by using a fixed mapping relationship between the 5^(th) periodof the second network device and the 7^(th) period of the third networkdevice. In this case, the 5^(th) period of the second network device isa latest period in ingoing periods that have mapping relationships withthe 7^(th) period of the third network device.

Further, the inbound interface of the third network device receives thepacket A, and the third network device searches for an outboundinterface through routing, and then maps the packet A to the 7^(th)period of the third network device by using a fixed mapping relationshipbetween the 4^(th) period of the first network device and the 7^(th)period of the third network device. In this case, the 4^(th) period ofthe first network device is an earliest period in ingoing periods thathave mapping relationships with the 7^(th) period of the third networkdevice.

Therefore, it can be learned from FIG. 2 that a maximum range of areceiving time of a packet to be sent in one period of the third networkdevice is T1+T2+Δ−Δ′.

Because a uniform period is set in the network, and is marked as T, amaximum range of a receiving time of a packet to be sent in one periodof the third network device is T′=2*T+Δ−Δ′.

For example, the first network device, the second network device, andthe third network device that are shown in FIG. 2 may be routers orother network devices that can forward data.

FIG. 2 mainly describes, from the perspective of a transmission jitter,a maximum range T′ of a receiving time of a packet to be sent in oneperiod, and the following briefly describes, with reference to FIG. 3and FIG. 4 , a quantity of needed label numbers of periods when adownstream network device receives packets in the plurality of periods.

FIG. 3 is a schematic diagram of a quantity of label numbers of periodsaccording to an embodiment of this application. The schematic diagramincludes an outbound interface of the third network device and receivingtime windows of a plurality of periods of the outbound interface.

T_(n)′ (n=3, 4, 5, 6) represents a receiving time window of an(n+1)^(th) period of the third network device.

When T′=2*T+Δ−Δ′, T is T in FIG. 2 , and packets are receivedsimultaneously in at most three periods of the outbound interface of thethird network device in FIG. 3 . Therefore, the third network deviceneeds three label numbers used to identify the periods of the thirdnetwork device.

Specifically, the quantity of the label numbers of the periods may bebriefly referred to as a quantity of period labels, which are physicallya quantity of packet receiving queues.

FIG. 4 is another schematic diagram of a quantity of period labelsaccording to an embodiment of this application. The schematic diagramincludes an outbound interface of the third network device and areceiving time window of each period of the outbound interface.

T_(n)′ (n=3, 4, 5, 6) represents a receiving time window of an(n+1)^(th) period of the third network device.

When T′=2*T+Δ−Δ′, it is assumed that T′ in FIG. 4 is greater than T inFIG. 3 , and packets are received simultaneously in at most four periodsof the outbound interface of the third network device in FIG. 4 .Therefore, the third network device needs four label numbers used toidentify the periods of the third network device.

It can be deduced from FIG. 3 and FIG. 4 that when packets are receivedsimultaneously in at most N periods of the outbound interface of thethird network device, the third network device needs N label numbersused to identify the periods of the third network device.

Specifically, N is a value obtained after T′/T is rounded up. In otherwords,

$N = {{\prod\left( {{T'}/T} \right)} = {\prod{\left( {2 + \frac{jitter}{T}} \right).}}}$

Therefore, a value of N depends on a value of the jitter (Δ−Δ), namely,a jitter between neighboring network devices.

In a packet forwarding method in the prior art, a uniform jitter is setfor an entire network, to implement packet forwarding betweenneighboring network devices.

The following briefly describes a method for forwarding a packet basedon the uniform jitter of the entire network.

FIG. 5 is a schematic diagram of packet forwarding in the prior art. Theschematic diagram includes S501 to S504.

S501. Set a uniform jitter.

A network 100 includes a plurality of network devices (as shown in FIG.1 ), and a system sets a uniform upper limit of a jitter betweenneighboring network devices for all network devices in the network 100.

It should be understood that when a forwarding architecture betweennetwork devices in the network 100 is a network processor (networkprocessor, NP), an order of magnitude of a jitter introduced by othermodules of the network devices is several microseconds (less than 10μs), in other words, a jitter between neighboring network devices in theNP forwarding architecture is small.

S502. A network device numbers periods.

Each network device in the network 100 calculates, based on the jitterthat is set in S501, a quantity of needed label numbers used to identifyperiods of the network device, and cyclically numbers the periods.

For example, the network 100 includes three network devices (a firstnetwork device, a second network device, and a third network device inFIG. 1 ), and

$N = {{\prod\left( {T^{\prime}/T} \right)} = {{\prod\left( {2 + \frac{jitter}{T}} \right)} = {3.}}}$Then, each of the three network devices cyclically numbers periods as 0,1, 2, . . . .

S503. Establish a mapping relationship between periods of neighboringnetwork devices.

An upstream neighboring network device sends a packet (carrying a periodlabel) to a downstream neighboring network device at a start moment of aperiod A. After receiving the packet, the downstream neighboring networkdevice uses, as an output period corresponding to the packet, a periodin which a moment of receiving the packet (the moment of receiving thepacket is a moment obtained by moving, backwards by the jitter, anactual moment at which the downstream neighboring network devicereceives the packet) is located. It is assumed that the correspondingoutput period is a period B of the downstream neighboring networkdevice. Then, a mapping relationship between the period A and the periodB is established.

Further, mapping relationships between a plurality of periods of theupstream neighboring network device and a plurality of periods of thedownstream neighboring network device are established based on themapping relationship between the period A and the period B.

For example, the first network device sends the packet A to the thirdnetwork device at a start moment of the 1^(st) period (the label numberis 0), where the packet A carries indication information of the labelnumber 0.

After receiving the packet, A, the third network device determines thata receiving moment is Ta. It is assumed that a period in which Ta+jitteris located is the 3^(rd) period (a label number is 2) of the thirdnetwork device.

Then, a mapping relationship between the 1^(st) period of the firstnetwork device and the 3^(rd) period of the third network device isestablished. Therefore, it can be learned that the 2^(nd) period of thefirst network device corresponds to the 4^(th) period of the thirdnetwork device. In other words, all packets C sent by the first networkdevice in the 1^(st) period are forwarded in the 3^(rd) period of thethird network device, and all packets D sent by the first network devicein the 2^(nd) period are forwarded in the 4^(th) period of the thirdnetwork device.

Specifically, an i^(th) period of the first network device correspondsto an (i+2)^(th) period of the third network device.

504. Perform Packet Forwarding.

Packet forwarding between network devices is implemented based on themapping relationship established in S503.

For example, after mapping relationships between periods of the firstnetwork device and periods of the third network device are establishedbased on the mapping relationship between the 1^(st) period of the firstnetwork device and the 3^(rd) period of the third network device, the3^(rd) period of the first network device corresponds to the 5^(th)period of the third network device.

Then, after receiving a packet carrying a label number of the 3^(rd)period of the first network device, the third network device forwardsthe packet in the 5^(th) period of the third network device.

The packet forwarding method in FIG. 5 is mainly applied to packetforwarding performed when all network devices in the network 100 use asame forwarding architecture.

Actually, all the network devices in the network 100 generally use aplurality of forwarding architectures.

For example, in addition to the NP forwarding architecture, actually,the network 100 may further include another network forwardingarchitecture.

For example, the network 100 includes both the NP forwardingarchitecture and an X86 forwarding architecture.

For the X86 forwarding architecture, an order of magnitude of a jitterintroduced by another module is usually 100 μs. In other words, for theX86 forwarding architecture, a jitter between neighboring networkdevices is large.

It is assumed that a uniform jitter is still set for the entire network.For different network forwarding architectures, expected delays(excluding a delay between lines) of the network are as follows:

In the NP forwarding architecture, an expected delay is h*(jitter+1.5T).

It is assumed that a period is 10 μs, and jitter=10 μs. Then, theexpected delay is equal to h*(jitter+1.5T)=h*(1T+1.5 T)=h*(2.5T).

In the X86 forwarding architecture, an expected delay ish*(jitter+1.5T).

It is assumed that a period is 10 μs, and jitter=100 μs. Then, theexpected delay is equal to h*(jitter+1.5T)=h*(10T+1.5 T)=h*(11.5T).

3. It is assumed that the network includes both the NP forwardingarchitecture and the X86 forwarding architecture. To ensure that anexpected delay of the X86 forwarding architecture is met, a uniformjitter set for the entire network should be 100 μs, and an expecteddelay is h*(11.5T).

In other words, the uniform jitter is set for the entire network. Whenthe network 100 includes a plurality of forwarding architectures, theuniform jitter that is set meets a forwarding architecture having alongest expected delay. As a result, for a forwarding architecturehaving a short expected delay, a delay is excessively long, andforwarding efficiency is affected.

To resolve the foregoing problem, this application provides a periodmapping method. No uniform jitter is set in the network 100. Instead, ajitter corresponding to each network device is set based on an actualstatus of a jitter of the network device.

An expected end-to-end delay when the entire network includes aplurality of forwarding architectures is:h1*(jitter_1+1.5T)+h2*(jitter_2+1.5T)+h3*(jitter_3+1.5T)+hi*(jitter_i+1.5T),where

h1 is a quantity of hops between first forwarding architectures in theplurality of forwarding architectures, h2 is a quantity of hops betweensecond forwarding architectures in the plurality of forwardingarchitectures, h3 is a quantity of hops between third forwardingarchitectures in the plurality of forwarding architectures, hi is aquantity of hops between i^(th) forwarding architectures in theplurality of forwarding architectures, jitter1 is a jitter in the firstforwarding architecture, jitter2 is a jitter in the second forwardingarchitecture, jitter3 is a jitter in the third forwarding architecture,and jitter_i is a jitter in the i^(th) forwarding architecture.

For example, in the network 100, the first network device and the secondnetwork device use the NP forwarding architecture, and the third networkdevice uses the X86 forwarding architecture.

A packet sent in a period of the first network device is first sent to aperiod of the second network device. Second, the second network devicesends the packet to a period of the third network device in the periodof the second network device.

Then, an expected end-to-end delay of sending, by the first networkdevice, the packet is:

h1*(jitter_1+1.5T)+h2*(jitter_2+1.5 T), where because the first networkdevice and the second network device use the NP forwarding architecture,jitter_1=10 μs, and because the third network device uses the X86forwarding architecture, jitter_2=100 μs.

When T=10 μs, the expected end-to-end delay is equal to1*(2.5T)+1*(11.5T)=14T.

When a uniform jitter is set for the entire network as in the prior art,an expected end-to-end delay of sending, by the first network device,the packet is:h*(jitter_2+1.5T)=(h1+h2)*(11.5T)=23T.

It should be understood that it is merely an example that in the network100, the first network device and the second network device use the NPforwarding architecture, and the third network device uses the X86forwarding architecture, and this cannot limit the protection scope ofthis application. This application does not limit a quantity offorwarding architectures specifically included in the network, and aspecific type of a forwarding architecture.

It can be learned through the foregoing comparison that in thisembodiment of this application, when the network 100 includes aplurality of forwarding architectures, a corresponding jitter is setbased on an actual status of a network device, to reduce an expectedend-to-end delay.

Further, as shown in FIG. 2 to FIG. 4 that a quantity of label numbersthat are needed by each network device to identify periods of thenetwork device is set based on an actual status of a jitter of thenetwork device.

In other words, in this embodiment of this application, quantities oflabel numbers needed by network devices in the network to identifyperiods of the network devices may be inconsistent.

Therefore, neighboring network devices having different quantities oflabel numbers need to successfully communicate with each other whenforwarding a packet, to find a packet sending period.

This embodiment of this application can be applied to the network 100 inFIG. 1 . A plurality of network devices in the network 100 performpacket forwarding based on different forwarding architectures, andjitters corresponding to the forwarding architectures are different, orjitters of a plurality of network devices in the network 100 areinconsistent due to another reason.

For example, the first network device and the second network device inFIG. 1 use the NP forwarding architecture, and the third network deviceuses the X86 forwarding architecture.

Further, when the network 100 includes both the NP forwardingarchitecture and the X86 forwarding architecture, each network devicesets a corresponding jitter based on an actual capability of the networkdevice, and calculates, based on the specified jitter, a quantity oflabel numbers needed by the network device to identify periods of thenetwork device.

Numbering periods based on a quantity of corresponding label numbersused to identify the periods of a network device includes the followingseveral cases:

Label number ranges of some network devices in the network 100 are 0 tom−1, and label number ranges of some network devices are 0 to n−1.

A network device whose label number range is 0 to m−1 may be referred toas a network device of a category A, and a network device whose labelnumber range is 0 to n−1 may be referred to as a network device of acategory B in the following, where m and n are different positiveintegers.

Specifically, a period mapping between different network devicesincludes:

a mapping between a period of a network device of the category A and aperiod of a network device of the category A: a mapping relationship isestablished between a period indicated by 0 to m−1 and a periodindicated by 0 to m−1;

a mapping between a period of a network device of the category B and aperiod of a network device of the category B: a mapping relationship isestablished between a period indicated by 0 to n−1 and a periodindicated by 0 to n−1;

a mapping between a period of a network device of the category A and aperiod of a network device of the category B: a mapping relationship isestablished between a period indicated by 0 to m−1 and a periodindicated by 0 to n−1; and a mapping between a period of a networkdevice of the category B and a period of a network device of thecategory A: a mapping relationship is established between a periodindicated by 0 to n−1 and a period indicated by 0 to n−1.

When a period mapping between network devices is the mapping between theperiod of the network device of the category A and the period of thenetwork device of the category A, or the mapping between the period ofthe network device of the category B and the period of the networkdevice of the category B, a mapping relationship between periods of thenetwork devices may be a mapping performed by using a solution in FIG. 5.

When a period mapping between network devices is the mapping between theperiod of the network device of the category A and the period of thenetwork device of the category B, or the mapping between the period ofthe network device of the category B and the period of the networkdevice of the category A, a mapping relationship between the networkdevices may be a mapping performed by using a solution in FIG. 6 .

FIG. 6 is a schematic diagram of a period mapping method according to anembodiment of this application. The schematic diagram includes a firstnetwork device, a second network device, and S610 to S630.

It should be understood that the period mapping method shown in FIG. 6is merely used as a possible embodiment, and cannot limit the protectionscope of this application. The protection scope of this application issubject to the claims.

S610. The first network device receives first information sent by thesecond network device.

Specifically, in a network, the first network device is a downstreamnetwork device, and the second network device is an upstream networkdevice. In addition, a forwarding architecture of the first networkdevice is inconsistent with a forwarding architecture of the secondnetwork device, or a forwarding architecture of the first network deviceis consistent with a forwarding architecture of the second networkdevice, but a jitter of the first network device is inconsistent with ajitter of the second network device due to another reason. Thisapplication does not limit a reason causing the inconsistency betweenthe jitter of the first network device and the jitter of the secondnetwork device, and the inconsistency may be caused by hardware orsoftware.

For example, the first network device uses an NP forwardingarchitecture, and the second network device uses an X86 forwardingarchitecture; or

the first network device uses an X86 forwarding architecture, and thesecond network device uses an NP forwarding architecture; or

the first network device uses an application-specific integrated circuit(application specific integrated circuit, ASIC) forwarding architecture,and the second network device uses an NP forwarding architecture; or

both the first network device and the second network device use an X86forwarding architecture, but have inconsistent jitters or the like.

It should be understood that this embodiment of this application doesnot limit a specific forwarding architecture of the first networkdevice, and the first network device may use any forwarding architecturein the prior art. Similarly, this embodiment of this application doesnot limit a specific forwarding architecture of the second networkdevice, and the second network device may use any forwardingarchitecture in the prior art.

Specifically, the first information carries a first number, the firstnumber is a number of the 1^(st) period of the second network device,and is used to identify the 1^(st) period of the second network device,and the first number includes a first label number and a first groupnumber.

Optionally, the 1^(st) period of the second network device is a periodin which a start moment of a super frame of the second network device islocated.

Optionally, that the first information carries the first numberincludes: p bits of the first information are used to indicate a valueof the first label number; and q bits of the first information are usedto indicate a value of the first group number, where p and q arepositive integers.

For example, when a network protocol between the first network deviceand the second network device is internet protocol (internet protocol,IP) version 4 (briefly referred to as IPv4), the first information maybe:

a differentiated services code point (differentiated services codepoint, DSCP) and explicit congestion notification (explicit congestionnotification, ECN) field, where the field includes 8 bits in total, amost significant bit is set to 1, and it indicates that a differentiatedinternet protocol (differentiated internet protocol, DIP) function isenabled.

Specifically, a label number is filled in p least significant bits ofthe DSCP and ECN field, and a group number is filled in q bits moresignificant than the p least significant bits.

When the number of the 1^(st) period of the second network device is <0,0>, a binary value of the field is (10000000).

For another example, when a network protocol between the first networkdevice and the second network device is internet protocol (internetprotocol, IP) version 6 (briefly referred to as IPv6), the firstinformation may be a hop-by-hop transmission (hop by hop) extensionheader.

A number of a period is placed in a hop-by-hop transmission (hop by hop)extension header, and binary value representation of a label number anda group number is the same as that in IPv4. Details are not describedherein again.

It should be understood that, that the first information is the DSCP andECN field or the hop by hop extension header is merely an example, andthis cannot limit the protection scope of this application. In thisembodiment of this application, the first information may be otherindication information provided that the indication information can beused to carry the first number and indicate values of the first labelnumber and the first group number.

It should be further understood that, specifically, p bits of the firstinformation are used to indicate that the first label number is relatedto a maximum label number, and a maximum value of a decimal valuerepresented by a binary value of the p bits only needs to be greaterthan or equal to a maximum label number in label numbers of periods ofthe second network device. For example, the maximum label number in thelabel numbers of the periods of the second network device is 10, andthen p only needs to be greater than or equal to 4.

Specifically, q bits of the first information are used to indicate thatthe first group number is related to a maximum group number, and amaximum value of a decimal value represented by a binary value of the qbits only needs to be greater than or equal to a maximum group number inthe label numbers of the periods of the second network device.

Optionally, the first information may be understood as a probe packet.In other words, the first information is a packet used to establishperiod mapping relationships between periods of the first network deviceand the periods of the second network device.

Specifically, to meet a periodic forwarding condition, a moment at whichthe second network device sends the first information is a start momentof the 1^(st) period of the second network device. In this way, it canbe ensured that all packets sent by the second network device to thefirst network device in the 1^(st) period can be sent in a first periodof the first network device.

It should be understood that the second network device numbers eachperiod of the second network device before sending the first informationto the first network device, so that the first information carries thefirst number.

Specifically, the second network device needs to learn a quantity of thelabel numbers used to identify the periods of the second network deviceand a quantity of label numbers used to identify the periods of thefirst network device, to number each period of the second networkdevice.

The following describes, in detail with reference to FIG. 7 , how thesecond network device numbers each period of the second network device.

FIG. 7 is a schematic diagram of a method for numbering, by a secondnetwork device, the periods according to an embodiment of thisapplication. The schematic diagram includes S701 to S704.

S701. The second network device determines n.

Specifically, the second network device determines n based on a secondjitter jitter, where n is the quantity of the label numbers used toidentify the periods of the second network device, and the second jitteris a jitter of the second network device.

Optionally, the jitter of the second network device may be a delay froman inbound interface to an outbound interface of the second networkdevice; or the jitter of the second network device is a delay betweenmodules of the second network device.

It should be understood that after a forwarding architecture to whichthe second network device belongs is determined, the jitter of thesecond network device can be determined based on an empirical value.

This embodiment of this application does not limit how to determine thejitter of the second network device, and the jitter of the secondnetwork device may be determined by using any method for determining ajitter of a network device in the prior art.

For example, the second network device uses the NP forwardingarchitecture, and a period is set to 10 μs for the entire network. Thesecond jitter is 10 μs. Then, a quantity of period labels of the secondnetwork device is

$n = {{\prod\left( {2 + \frac{jitter}{T}} \right)} = {3.}}$

Alternatively, the second network device uses the X86 forwardingarchitecture, and a period is set to 10 μs for the entire network. Thesecond jitter is 100 μs. Then, a quantity of period labels of the secondnetwork device is

$n = {{\prod\left( {2 + \frac{jitter}{T}} \right)} = {1{2.}}}$

S702. The first network device determines m.

Specifically, the first network device determines m based on a firstjitter jitter, where m is the quantity of the label numbers used toidentify the periods of the first network device, and the first jitteris a jitter of the first network device.

Optionally, the jitter of the first network device may be a delay froman inbound interface to an outbound interface of the first networkdevice; or

the jitter of the first network device is a delay between modules of thefirst network device.

It should be understood that after a forwarding architecture to whichthe first network device belongs is determined, the jitter of the firstnetwork device can be determined based on an empirical value.

This embodiment of this application does not limit how to determine thejitter of the first network device, and the jitter of the first networkdevice may be determined by using any method for determining a jitter ofa network device in the prior art.

For example, the first network device uses the NP forwardingarchitecture, and a period is set to 10 μs for the entire network. Thefirst jitter is 10 μs. Then, a quantity of period labels of the firstnetwork device is

$n = {{\prod\left( {2 + \frac{jitter}{T}} \right)} = {3.}}$

Alternatively, the first network device uses the X86 forwardingarchitecture, and a period is set to 10 μs for the entire network. Thefirst jitter is 100 μs. Then, a quantity of period labels of the firstnetwork device is

$n = {{\prod\left( {2 + \frac{jitter}{T}} \right)} = {1{2.}}}$

S703. The first network device sends third information to the secondnetwork device.

The third information indicates m in S702.

Optionally, in some embodiments, the third information may be obtainedin the following manner: The first network device constructs, on eachinterface, one internet protocol (internet protocol, IP) packet whosetime to live (time to live, TTL) is 255, sends the packet to the secondnetwork device, and fills m in a field that is of the packet and that isused to indicate the quantity of the label numbers used to identify theperiods of the first network device.

For example, when a network protocol between the first network deviceand the second network device is IPv4, the third information is a DSCPand ECN field.

The DSCP and ECN field includes 8 bits in total. A most significant bitis set to 1, and it indicates that a DIP function is enabled. Thequantity of the label numbers used to identify the periods of the firstnetwork device is filled in p least significant bits, m=3, and a binaryvalue of the DSCP and ECN field is (10000011).

When a network protocol between the first network device and the secondnetwork device is IPv6, m is placed in a hop by hop extension header,and a binary value is the same as that in IPv4. Details are notdescribed herein again.

Optionally, in some other embodiments, the third information may beobtained in the following manner: The first network device constructs,on each interface, one internet protocol (internet protocol, IP) packetwhose time to live (time to live, TTL) is 255, sends the packet to thesecond network device, and fills a maximum value in a range of the labelnumbers of the periods of the first network device in a field that is ofthe packet and that is used to indicate the quantity of the labelnumbers used to identify the periods of the first network device.

For example, the third information is the DSCP and ECN field, and themaximum value of the label numbers of the periods is filled in p leastsignificant bits of the DSCP and ECN field. When m=3, and a range of thelabel numbers of the periods of the second network device is 0 to 2, abinary value of the DSCP and ECN field is (10000010). Alternatively,when m=3, and a range of the label numbers of the periods of the secondnetwork device is 1 to 3, a binary value of the DSCP and ECN field is(10000011).

Optionally, in some other embodiments, the third information may beindication information that is sent by the first network device to thesecond network device before the first network device and the secondnetwork device perform packet forwarding, and the third informationcarries m or m−1.

It should be understood that this embodiment of this application doesnot limit a specific form of the third information provided that thethird information can be used to notify the second network device of thequantity (m) of the label numbers used to identify the periods of thefirst network device.

S704. The second network device numbers periods.

After receiving the third information in S703, the second network devicenumbers each period of the second network device based on m and n.

Specifically, that the second network device numbers each period of thesecond network device based on m and n includes the following steps:

The second network device calculates a least common multiple L of m andn.

Specifically, L*T is referred to as one super frame of the secondnetwork device, and one super frame includes L periods.

The second network device determines, based on L and n, a quantity y ofgroups into which the periods of the second network device can bedivided.

Specifically, y=L/n. All periods in one super frame of the secondnetwork device are divided into y groups, and each group of periodsincludes n periods.

The second network device numbers each period of the second networkdevice based on n and y, where the number of each period of the secondnetwork device includes a label number and a group number.

Optionally, in some embodiments, the second network device may calculatea common multiple L_(x) of m and n based on m and n, and number theperiods based on any common multiple of m and n.

In this application, the least common multiple L of m and n is selected,to improve packet forwarding performance to the greatest extent.

For example, the first network device uses the NP forwardingarchitecture, and the second network device uses the X86 forwardingarchitecture.

Then, in S701 in FIG. 7 , the second network device determines that

${n = {{\prod\left( {2 + \frac{jitter}{T}} \right)} = {12}}},$and in S702 in FIG. 7 , the first network device determines that

$m = {{\prod\left( {2 + \frac{jitter}{T}} \right)} = 3.}$

Further, the second network device calculates that the least commonmultiple L of m and n is 12.

Then, y=L/n=1. In other words, all periods of the second network deviceare divided into one group, and the group of periods includes 12periods.

The second network device numbers each period of the second networkdevice based on 12 and 1, where the number of each period of the secondnetwork device includes the label number and the group number.

Specifically, when the second network device numbers each period of thesecond network device, a range of the label numbers in the numbers ofthe periods of the second network device may be 0 to n−1, and the groupnumbers may be 0 to y−1; or

a range of the label numbers in the numbers of the periods of the secondnetwork device may be 1 to n, and the group numbers may be 1 to y.

It should be understood that this application does not limit a specificrange of the label numbers and a specific range of the group numbers,and the ranges each may be any range agreed on by the first networkdevice and the second network device. In other words, the first networkdevice and the second network device only need to use a numbering mannerthat can be identified by each other.

For example, when y=1, and n=12, the numbers of the periods of thesecond network device may be:

the number of the 1^(st) period of the second network device is <0, 0>;

a number of the 2^(nd) period of the second network device is <0, 1>;

a number of the 3rd period of the second network device is <0, 2>;

. . .

a number of a j^(th) period of the second network device is <i, j−1>,where i=0, j is a positive integer, and j=1, 2, 3, . . . , 12.

It can be learned from the foregoing description that the number of eachperiod of the second network device is a two-dimensional array, thefirst element in the two-dimensional array is used to represent thelabel number of the period, and the second element in thetwo-dimensional array is used to represent the group number of theperiod.

It should be understood that, that the second network device numberseach period of the second network device is merely an example, and thereis another numbering manner.

For example, when values of m and n are different; or

the second element in the two-dimensional array is used to indicate thelabel number of the period, and the first element in the two-dimensionalarray is used to indicate the group number of the period; or

a different range of label numbers is used and/or a different range ofgroup numbers is used, and details are not described herein again.

After receiving the first information sent by the second network device,and obtaining the number of the 1^(st) period of the second networkdevice, the first network device performs S620.

S620. The first network device determines a first period.

Specifically, after receiving the first information, the first networkdevice determines the first period that can be used to send the firstinformation. A second number of the first period includes a second labelnumber and a second group number.

It should be understood that the first period determined by the firstnetwork device can be used to send the first information, but thisapplication does not impose such a limitation that the first networkdevice should forward the first information to a downstream device ofthe first network device.

In other words, after the first network device receives the firstinformation, and the determined first period can be used to send thefirst information, when the first information needs to be forwarded toanother network device, the first network device needs to forward thefirst information to a downstream network device in the first period; orwhen the first information does not need to be forwarded to anothernetwork device, the first network device uses the first perioddetermined for the first information.

It should be further understood that a reason why the first networkdevice can determine the second number of the first period afterdetermining the first period that can be used to send the firstinformation is that the first network device numbers each period of thefirst network device before receiving the first information.

Specifically, the first network device needs to learn the quantity ofthe label numbers used to identify the periods of the first networkdevice and the quantity of the label numbers used to identify theperiods of the second network device, to number each period of the firstnetwork device.

The following describes, in detail with reference to FIG. 8 , how thefirst network device numbers each period of the first network device.

FIG. 8 is a schematic diagram of a method for numbering, by the firstnetwork device, the periods according to an embodiment of thisapplication. The schematic diagram includes S801 to S804.

S802. The first network device determines m.

Specifically, the first network device determines m based on the firstjitter jitter. This is similar to S702 in FIG. 7 , and details are notdescribed herein again.

S802. The second network device determines n.

Specifically, the second network device determines n based on the secondjitter jitter. This is similar to S701 in FIG. 7 , and details are notdescribed herein again.

S803. The first network device receives second information sent by thesecond network device.

The second information indicates n in S802.

Optionally, in some other embodiments, the second information may beobtained in the following manner: The second network device constructs,on each interface, one internet protocol (internet protocol, IP) packetwhose time to live (time to live, TTL) is 255, sends the packet to thefirst network device, and fills n in a field that is of the packet andthat is used to indicate the quantity of the label numbers used toidentify the periods of the second network device.

For example, when a network protocol between the first network deviceand the second network device is IPv4, the second information is a DSCPand ECN field.

The DSCP and ECN field includes 8 bits in total. A most significant bitis set to 1, and it indicates that a DIP function is enabled. Thequantity of the label numbers used to identify the periods of the secondnetwork device is filled in p least significant bits, n=12, and a binaryvalue of the DSCP and ECN field is (10001100).

When a network protocol between the first network device and the secondnetwork device is IPv6, n is placed in a hop by hop extension header,and a binary value is the same as that in IPv4. Details are notdescribed herein again.

Optionally, in some other embodiments, the second information may beobtained in the following manner: The second network device constructs,on each interface, one internet protocol (internet protocol, IP) packetwhose time to live (time to live, TTL) is 255, sends the packet to thefirst network device, and fills a maximum value in a range of the labelnumbers of the periods of the second network device in a field that isof the packet and that is used to indicate the quantity of the labelnumbers used to identify the periods of the second network device.

For example, the second information is the DSCP and ECN field, and themaximum value of the label numbers of the periods is filled in p leastsignificant bits of the DSCP and ECN field. When n=12, and a range ofthe label numbers of the periods of the second network device is 0 to11, a binary value of the DSCP and ECN field is (10001011).Alternatively, when n=12, and a range of the label numbers of theperiods of the second network device is 1 to 12, a binary value of theDSCP and ECN field is (10001100).

Optionally, in some other embodiments, the second information may beindication information that is sent by the second network device to thefirst network device before the second network device and the firstnetwork device perform packet forwarding, and the second informationcarries n or n−1.

It should be understood that this embodiment of this application doesnot limit a specific form of the second information provided that thesecond information can be used to notify the first network device of thequantity (n) of the label numbers used to identify the periods of thesecond network device.

S804. The first network device numbers the periods.

After receiving the second information in S803, the first network devicenumbers each period of the first network device based on m and n.

Specifically, that the first network device numbers each period of thefirst network device based on m and n includes the following steps:

The first network device calculates a least common multiple L of m andn.

Specifically, L*T is referred to as one super frame of the first networkdevice. A size of one super frame of the first network device is equalto a size of one super frame of the second network device. In otherwords, the quantity of the periods of the first network device in onesuper frame is equal to the quantity of the periods of the secondnetwork device in one super frame, and only the numbers of the periodsare different.

The first network device determines, based on L and m, a quantity x ofgroups into which the periods of the second network device can bedivided.

Specifically, x=L/m. All periods in one super frame of the first networkdevice are divided into x groups, and each group of periods includes mperiods.

The first network device numbers each period of the first network devicebased on m and x, where the number of each period of the first networkdevice includes a label number and a group number.

Optionally, in some embodiments, the first network device may calculatea common multiple L_(x) of m and n based on m and n, and number theperiods based on any common multiple of m and n.

In this application, the least common multiple L of m and n is selected,to improve packet forwarding performance to the greatest extent.

For example, the first network device uses the NP forwardingarchitecture, and the second network device uses the X86 forwardingarchitecture.

Then, in S801 in FIG. 8 , the first network device determines that

${m = {{\prod\left( {2 + \frac{{jitt}er}{T}} \right)} = 3}},$and in S802 in FIG. 8 , the second network device determines that

$n = {{\prod\left( {2 + \frac{jitter}{T}} \right)} = 12.}$

Further, the first network device calculates that the least commonmultiple L of m and n is 12.

Then, x=L/m=4. In other words, all periods of the first network deviceare divided into four groups, and each group of periods includes threeperiods.

The first network device numbers each period of the first network devicebased on 3 and 4, where the number of each period of the first networkdevice includes the label number and the group number.

Specifically, when the first network device numbers each period of thefirst network device, a range of the label numbers in the numbers of theperiods of the first network device may be 0 to m−1, and the groupnumbers may be 0 to x−1; or

a range of the label numbers in the numbers of the periods of the firstnetwork device may be 1 to m, and the group numbers may be 1 to x.

It should be understood that this application does not limit a specificrange of the label numbers and a specific range of the group numbers,and the ranges each may be any range agreed on by the first networkdevice and the second network device.

For example, when x=4, and m=3, the numbers of the periods of the firstnetwork device in one super frame may be:

a number of the 1^(st) period of the first network device is <0, 0>;

a number of the 2^(nd) period of the first network device is <0, 1>;

a number of the 3^(rd) period of the first network device is <0, 2>;

a number of the 4^(th) period of the first network device is <1, 0>;

. . .

a number of a k^(th) period of the second network device is <i, j>,where i=0, 1, 2, 3, j=0, 1, 2, and k=1, 2, 3, . . . , 12. The numbers ofthe periods in one super frame are described above, and the periods ineach super frame are cyclically numbered in this manner.

It can be learned from the foregoing description that the number of eachperiod of the first network device is a two-dimensional array, the firstelement in the two-dimensional array is used to represent the labelnumber of the period, and the second element in the two-dimensionalarray is used to represent the group number of the period.

It should be understood that, that the first network device numbers eachperiod of the second network device is merely an example, and there isanother numbering manner.

For example, when values of m and n are different; or

the second element in the two-dimensional array is used to indicate thelabel number of the period, and the first element in the two-dimensionalarray is used to indicate the group number of the period; or

a different range of label numbers is used and/or a different range ofgroup numbers is used, and details are not described herein again.

It should be understood that as shown in FIG. 7 and FIG. 8 , a networkdevice obtains a quantity of label numbers that are of the networkdevice and that are used to identify periods and a quantity of labelnumbers that are of a peer end network device and that are used toidentify periods, and calculates a least common multiple of thequantities of the label numbers used to identify the periods; andcalculates, based on the least common multiple, a quantity of groupsinto which all periods in one super frame of the network device can bedivided, where one super frame includes L (the least common multiple)periods. Therefore, the method for cyclically numbering the periodsbased on the array and the quantity of label numbers used to identifythe periods may be further applied to another scenario. In thisapplication, that the method is applied to period mapping is merely anexample.

Specifically, that the first network device determines that the firstinformation is sent in the first period includes:

determining, by the first network device based on a first moment and thefirst jitter jitter, that the first information is sent in the firstperiod, where the first moment is a moment at which the first networkdevice receives the first information, and the first jitter is a jitterof the first network device.

Specifically, the first period is a period to which the first momentplus the first jitter jitter belongs.

For example, the first network device receives the first information ata moment t1, the first jitter is 10 μs, and a system period is 10 μs.Then, a period in which the moment t1 deviated backwards by one periodis located is the first period.

Optionally, FIG. 6 further includes S630: The first network deviceestablishes a mapping relationship.

For example, because the first label number and the first group numbermeet a mapping relationship with the second label number and the secondgroup number, the first network device can establish mappingrelationships between the numbers of the plurality of periods of thefirst network device and the numbers of the plurality of periods of thesecond network device based on the mapping relationship.

It may be understood that, that the first label number and the firstgroup number meet the mapping relationship with the second label numberand the second group number means that the 1^(st) period of the secondnetwork device meets the mapping relationship with the first period ofthe first network device. It indicates that each period of the firstnetwork device meets the mapping relationship with each period of thesecond network device.

Specifically, the mapping relationship may be an offset. In other words,the 1^(st) period of the second network device plus the offsetcorresponds to the first period of the first network device.

It should be understood that, that the first network device establishesthe mapping relationships between the numbers of the plurality ofperiods of the first network device and the numbers of the plurality ofperiods of the second network device based on the mapping relationshipis merely an example. The first network device may further directlyforward a received packet based on the mapping relationship.

For example, the mapping relationship is an offset. After receiving apacket sent by the second network device, after deviating a packetsending period by the offset based on a number of the packet sendingperiod, the first network device obtains a period that is of the firstnetwork device and that is used to forward the packet. In this case, thefirst network device does not need to establish the mappingrelationships between all periods of the first network device and allperiods of the second network device, and store the mappingrelationships, but only needs to obtain, based on the offset afterreceiving the packet, the period used to forward the packet, to savestorage space of the first network device.

For example, the mapping relationships between the numbers of theplurality of periods of the first network device and the numbers of theplurality of periods of the second network device are one-to-one mappingrelationships.

For example, the first network device uses the NP forwardingarchitecture, and the second network device uses the X86 forwardingarchitecture.

The number of the 1^(st) period of the second network device is <0, 0>.In other words, the first label number is equal to 0, and the firstgroup number is equal to 0. The first network device receives the firstinformation at the moment t1, where the moment t1 is located in the2^(nd) period of the first network device, and the number of the 1^(st)period of the first network device is <0, 1>. It may be determined thata first offset is one period.

That the first network device determines the first period based on themoment t1 and the first jitter after determining the moment t1 includesthe following steps:

In this embodiment, the first network device uses the NP forwardingarchitecture, the first jitter is set to 10 μs, and when the period Tfor the entire network is 10 μs, a value of the first jitter is oneperiod T.

Specifically, the moment t1 is deviated backwards by one period, toobtain the first period. Then, the first period is the 3^(rd) period ofthe first network device, and the number of the 1^(st) period of thefirst network device is <0, 2>.

Then, it can be learned that a total offset is two periods. In thiscase, one-to-one mapping relationships between the numbers of theplurality of periods of the first network device and the numbers of theplurality of periods of the second network device are shown in Table 1.

TABLE 1 Mapping table Source group Source label Destination groupDestination label number number number number 0 0 0 2 0 1 1 0 0 2 1 1 03 1 2 0 4 2 0 0 5 2 1 0 6 2 2 0 7 3 0 0 8 3 1 0 9 3 2 0 10 0 0 0 11 0 1

Because the first network device is a packet receiving network device,and the second network device is a packet sending network device, inTable 1, the source group number is a group number in a number of aperiod of the second network device, the source label number is a labelnumber in the number of the period of the second network device, thedestination group number is a group number in a number of a period ofthe first network device, and the destination label number is a labelnumber in the number of the period of the first network device.

Correspondences between the plurality of periods of the first networkdevice and the plurality of periods of the second network device areshown in FIG. 9 .

FIG. 9 is a schematic diagram of a period mapping according to anembodiment of this application.

For another example, when the first network device in FIG. 9 is anupstream network device, and the second network device is a downstreamnetwork device, the correspondences between the plurality of periods ofthe first network device and the plurality of periods of the secondnetwork device may be shown in FIG. 10 .

FIG. 10 is a schematic diagram of another period mapping according to anembodiment of this application.

The number of the 1^(st) period of the first network device is <0, 0>.In other words, the first label number is equal to 0, and the firstgroup number is equal to 0. The second network device receives the firstinformation at the moment t1, where the moment t1 is located in thesecond period of the second network device, the number of the 1^(st)period of the second network device is <0, 1>, and a first offset is oneperiod.

Because the jitter of the second network device is 10 T, the secondnetwork device determines that the first period is obtained by deviatingthe moment t1 backwards by 10 periods.

Then, the first period is the 12^(th) period of the second networkdevice, and a number of the 12^(th) period of the second network deviceis <0, 11>.

It may be learned that the total offset is one period plus 10 periods,namely, 11 periods in total.

It should be understood that the schematic diagrams of the periodmappings in FIG. 9 and FIG. 10 are merely examples, and cannot limit theprotection scope of this application. The period mapping method in FIG.6 of this application may be further applied to a network device usinganother forwarding architecture.

The following describes, with reference to a specific embodiment, aspecific implementation when the period mapping method in thisembodiment of this application is used to forward a packet.

FIG. 11 is a schematic diagram of a specific embodiment of thisapplication. The specific embodiment includes a third network device, afourth network device, and a fifth network device.

Specifically, the third network device, the fourth network device, andthe fifth network device are any three network devices in a network. Thefifth network device is a downstream network device of the third networkdevice and the fourth network device. A value of a period in the networkis 10 μs.

S110. The third network device determines a third jitter.

For example, the third network device uses an NP forwardingarchitecture, and the third jitter is 10 μs.

S111. The fourth network device determines a fourth jitter.

For example, the fourth network device uses an NP forwardingarchitecture, and the fourth jitter is 10 μs.

S112. The fifth network device determines a fifth jitter.

For example, the fifth network device uses the NP forwardingarchitecture, and the fifth jitter is 80 μs.

S120. The third network device determines m3.

m3 is a quantity of label numbers used to identify periods of the thirdnetwork device.

Specifically,

${m3} = {{\prod\left( {2 + \frac{jitter}{T}} \right)} = {3.}}$

S121. The fourth network device determines m4.

m4 is a quantity of label numbers used to identify periods of the fourthnetwork device.

Specifically,

${m4} = {{\prod\left( {2 + \frac{jitter}{T}} \right)} = {3.}}$

S122. The fifth network device determines m5.

m5 is a quantity of label numbers used to identify periods of the fourthnetwork device.

Specifically,

${m5} = {{\prod\left( {2 + \frac{jitter}{T}} \right)} = 10.}$

S130. The third network device and the fourth network device notify eachother of the quantities of the label numbers of the periods.

This specifically includes the following steps:

The third network device constructs, on each interface, an IP packetwhose TTL is 255, sends the packet to the fourth network device, andfills m3 in a label field.

For example, when a network protocol between the third network deviceand the fourth network device is IPv4, a packet used to notify each ofthe third network device and the fourth network device of the quantityof the label numbers of the periods may be a DSCP and ECN field, andincludes 8 bits in total. A most significant bit is set to 1, and itindicates that a DIP function is enabled. The quantity of the labelnumbers used to identify the periods of the third network device isfilled in p least significant bits, m3=3, and a binary value of the DSCPand ECN field is (10000011).

When a network protocol between the third network device and the fourthnetwork device is IPv6, m3 is placed in a hop by hop extension header,and a binary value is the same as that in IPv4.

For another example, a maximum value of the label numbers of the periodsis filled in p least significant bits of the DSCP and ECN field. Whenm3=3, and a range of the label numbers of the periods of the thirdnetwork device is 0 to 2, a binary value of the DSCP and ECN field is(10000010). Alternatively, when m3=3, and a range of the label numbersof the periods of the third network device is 1 to 3, a binary value ofthe DSCP and ECN field is (10000011).

The fourth network device constructs, on each interface, an IP packetwhose TTL is 255, sends the packet to the third network device, andfills a label number in a label field.

For example, when a network protocol between the third network deviceand the fourth network device is IPv4, the DSCP and ECN field is thelabel field, and includes 8 bits in total. A most significant bit is setto 1, and it indicates that a DIP function is enabled. The quantity ofthe label numbers used to identify the periods of the fourth networkdevice is filled in a least significant bit, m4=3, and a binary value ofthe field is (10000011).

When a network protocol between the third network device and the fourthnetwork device is IPv6, m4 is placed in a hop by hop extension header,and a binary value is the same as that in IPv4.

S131. The fourth network device and the fifth network device notify eachother of the quantities of the label numbers of the periods.

This specifically includes the following steps:

The fourth network device constructs, on each interface, an IP packetwhose TTL is 255, sends the packet to the fifth network device, andfills the label number in a label field.

For example, when a network protocol between the fourth network deviceand the fifth network device is IPv4, the DSCP and ECN field includes 8bits in total. A most significant bit is set to 1, and it indicates thata DIP function is enabled. The quantity of the label numbers used toidentify the periods of the fourth network device is filled in a leastsignificant bit, m4=3, and a binary value of the field is (10000011).

When a network protocol between the fourth network device and the fifthnetwork device is IPv6, m3 is placed in a hop by hop extension header,and a binary value is the same as that in IPv4.

The fifth network device constructs, on each interface, an IP packetwhose TTL is 255, sends the packet to the fourth network device, andfills the label number in a label field.

For example, when a network protocol between the fifth network deviceand the fourth network device is IPv4, the DSCP and ECN field includes 8bits in total. A most significant bit is set to 1, and it indicates thata DIP function is enabled. The quantity of the label numbers used toidentify the periods of the fifth network device is filled in a leastsignificant bit, m5=10, and a binary value of the field is (10001010).

When a network protocol between the fifth network device and the fourthnetwork device is IPv6, m5 is placed in a hop by hop extension header,and a binary value is the same as that in IPv4.

S140. The fourth network device numbers the periods.

Specifically, the fourth network device numbers each period of thefourth network device based on m4 and m5.

Because m4=3, and m5=10, the fourth network device calculates a commonmultiple L1 of m4 and m5, and determines, based on L1 and m4, a quantityx1 of groups into which the periods of the fourth network device can bedivided:x1=L1/m4=30/3=10.

The fourth network device numbers each period of the fourth networkdevice based on m4 and x1. Specifically, the number of each period ofthe fourth network device includes a label number and a group number.

Optionally, the label number is one of 0 to m4−1, and the group numberis one of 0 to x1−1.

For example, a number of the 1^(st) period of the fourth network deviceis (0, 0), a number of the 2^(nd) period of the fourth network device is(1, 0), a number of the 3^(rd) period of the fourth network device is(2, 0), a number of the 4^(th) period of the fourth network device is(0, 1), . . . .

Specifically, the number of each period of the fourth network device isshown in the first line of FIG. 12 . FIG. 12 is a schematic diagram ofstill another period mapping according to an embodiment of thisapplication.

Optionally, the label number is one of 1 to m4, and the group number isone of 1 to x1.

For example, the number of the 1^(st) period of the fourth networkdevice is (1, 1), the number of the 2^(nd) period of the fourth networkdevice is (2, 1), the number of the 3^(rd) period of the fourth networkdevice is (3, 1), the number of the 4^(th) period of the fourth networkdevice is (1, 2), . . . .

Specifically, the number of each period of the fourth network device isshown in the first line of FIG. 13 . FIG. 13 is a schematic diagram ofstill another period mapping according to an embodiment of thisapplication.

S141. The fifth network device numbers the periods.

Specifically, the fifth network device numbers each period of the fifthnetwork device based on m4 and m5.

Because m4=3, and m5=10, the fifth network device calculates a commonmultiple L1 of m4 and m5, and determines, based on L1 and m5, a quantityx2 of groups into which the periods of the fifth network device can bedivided:x2=L1/m5=30/10=3

The fifth network device numbers each period of the fifth network devicebased on m5 and x2. Specifically, the number of each period of the fifthnetwork device includes a label number and a group number.

Optionally, the label number is one of 0 to m5−1, and the group numberis one of 0 to x2−1.

For example, a number of the 1^(st) period of the fifth network deviceis (0, 0), a number of the 2^(nd) period of the fifth network device is(1, 0), a number of the 3^(rd) period of the fifth network device is (2,0), a number of the 4^(th) period of the fifth network device is (3, 0),. . . .

Specifically, the number of each period of the fifth network device isshown in the second line of FIG. 12 .

Optionally, the label number is one of 1 to m5, and the group number isone of 1 to x2.

For example, the number of the 1^(st) period of the fifth network deviceis (1, 1), the number of the 2^(nd) period of the fifth network deviceis (2, 1), the number of the 3^(rd) period of the fifth network deviceis (3, 1), the number of the 4^(th) period of the fifth network deviceis (4, 1), . . . .

Specifically, the number of each period of the fifth network device isshown in the second line of FIG. 13 .

S150. The third network device and the fourth network device performperiod mapping.

A period label range of the third network device is the same as a periodlabel range of the fourth network device, and period mapping isperformed by using the prior art, for example, the period mapping methodin FIG. 5 .

S160. The fourth network device and the fifth network device performperiod mapping.

The period label range of the fourth network device is different from aperiod label range of the fifth network device, and the followingmapping solution is used:

The fourth network device sends a probe packet at a start moment of onesuper frame.

Optionally, a group number carried in the probe packet is 0, and a labelis 0. A label of a period in which an arrival moment at which the probepacket arrives at the fifth network device is located is 7, a groupnumber is 0, and a first offset is 8 Ts, as shown in FIG. 12 .

Specifically, the start moment of the super frame may be understood as astart moment of the 1^(st) period of the fourth network device. Thesuper frame is a product of a value of a period stipulated in a systemand the least common multiple:super frame=L1*T.

The fifth network device deviates the arrival moment of the packet, anda deviation manner is adding a jitter to the arrival moment of thepacket.

In this embodiment, the jitter is 80 μs, that is, 8 Ts. As shown in FIG.12 , the arrival moment of the packet plus the jitter is the groupnumber 1 and the label 5. A total offset is 16 Ts.

The fifth network device establishes mapping relationships between theperiods of the fourth network device and the periods of the fifthnetwork device, and details are shown in Table 2.

TABLE 2 Mapping table Source group Source group Source group Sourcegroup number number number number 0 0 1 5 0 1 1 6 0 2 1 7 1 0 1 8 1 1 19 1 2 2 0 . . . . . . . . . . . .

Optionally, a group number carried in the probe packet is 1, and a labelis 1. A label of a period in which an arrival moment at which the probepacket arrives at the fifth network device is located is 8, a groupnumber is 1, and a first offset is 8 Ts, as shown in FIG. 13 .

The fifth network device deviates the arrival moment of the packet, anda deviation manner is adding a jitter to the arrival moment of thepacket.

In this embodiment, the jitter is 80 μs, that is, 8 Ts. As shown in FIG.13 , the arrival moment of the packet plus the jitter is the groupnumber 2 and the label 6. A total offset is 16 Ts.

The fifth network device establishes the mapping relationships betweenthe periods of the fourth network device and the periods of the fifthnetwork device, and details are shown in Table 3.

TABLE 3 Mapping table Source group Source label Destination groupDestination label number number number number 1 1 2 6 1 2 2 7 1 3 2 8 21 2 9 2 2 2 10 2 3 3 1 . . . . . . . . . . . .

The fifth network device performs scheduling by using the mapping table:Subsequently, when receiving a packet sent by the fourth network device,the fifth network device selects, based on the mapping relationship, aperiod that corresponds to the destination label number and thedestination group number, performs forwarding by using the period,replaces a label carried in the packet with a destination label, andreplaces a group number carried in the packet with the destination groupnumber.

Specifically, a period number carried in the packet sent by the fourthnetwork device includes the following:

When a network protocol between the fourth network device and the fifthnetwork device is IPv4, the DSCP and ECN field may be used to carry theperiod number. The DSCP and ECN field includes 8 bits in total. A mostsignificant bit is set to 1, and it indicates that a DIP function isenabled.

When m4 of the fourth network device is equal to 3, and the quantity ofgroups is x1=10, the label number is filled in two least significantbits, and the group number is filled in 4 bits more significant than the2 least significant bits.

For example, the fifth network device receives a packet that is sent inthe 6^(th) period of the fourth network device. A number of the sixthperiod of the fourth network device is <1, 2>, where a source groupnumber is 1, and a source label number is 2. Then, a binary value of theDSCP and ECN field is (10000110), and it is obtained by searching Table2 that the destination group number is 2 and the destination labelnumber is 0.

Then, the packet that is sent in the 6^(th) period of the fourth networkdevice and that is received by the fifth network device is sent in the21^(st) period of the fifth network device. The period number <1, 2>carried in the packet is updated to <2, 0>, or to a number that can beused by a downstream device of the fifth network device to determine acorresponding sending period, so that the downstream device of the fifthnetwork device determines a period of forwarding the packet.

For another example, the fifth network device receives a packet that issent in the 4^(th) period of the fourth network device. A number of the4^(th) period of the fourth network device is <2, 1>, where a sourcegroup number is 2, and a source label number is 1. Then, a binary valueof the DSCP and ECN field is (10001001), and it is obtained by searchingTable 2 that the destination group number is 3 and the destination labelnumber is 9.

Then, the packet that is sent in the 4^(th) period of the fourth networkdevice and that is received by the fifth network device is sent in the29^(th) period of the fifth network device. The period number <2, 1>carried in the packet is updated to <3, 9>, or to a number that can beused by a downstream device of the fifth network device to determine acorresponding sending period, so that the downstream device of the fifthnetwork device determines a period of forwarding the packet.

When a network protocol between the fourth network device and the fifthnetwork device is IPv6, the period number is placed in a hop by hopextension header, and a binary value is the same as that in IPv4.Details are not described herein again.

It should be understood that FIG. 9 to FIG. 13 are merely an exampleform, and cannot limit the protection scope of this application. Forexample, the fifth jitter may be 100 μs, or the fourth jitter may be 11μs.

Cases are not described herein one by one.

It should be noted that in this embodiment of this application, first,second, third, and the like are merely used for ease of distinguishingbetween different objects, and should not constitute any limitation tothis application, for example, first, second, third, and the like areused to distinguish between different network devices, differentindication information, and the like.

The foregoing describes, in detail with reference to FIG. 6 to FIG. 13 ,the period mapping method provided in the embodiments of thisapplication, and the following describes, in detail with reference toFIG. 14 to FIG. 17 , a first network device and a second network devicethat are provided in the embodiments of this application.

FIG. 14 is a schematic block diagram of a first network device 1400according to an embodiment of this application. The first network deviceincludes a sending unit 1401, a receiving unit 1402, and a processingunit 1403.

The receiving unit 1402 is configured to receive first information sentby a second network device, where the first information carries a firstnumber, the first number is a number of the 1^(st) period of the secondnetwork device, and the first number includes a first label number and afirst group number.

The processing unit 1403 is configured to determine a first period thatcan be used to send the first information, where a second number of thefirst period includes a second label number and a second group number,and the first label number and the first group number meet a mappingrelationship with the second label number and the second group number.

The processing unit 1403 is further configured to establish mappingrelationships between numbers of a plurality of periods of the firstnetwork device and numbers of a plurality of periods of the secondnetwork device based on the mapping relationship.

Optionally, that the processing unit 1403 is configured to determine thefirst period that can be used to send the first information includes:the processing unit 1403 determines, based on a first moment and thefirst jitter jitter, the first period that can be used to send the firstinformation, where the first moment is a moment at which the firstnetwork device receives the first information, and the first jitter is ajitter of the first network device.

Optionally, before the receiving unit 1402 receives the firstinformation sent by the second network device, the processing unit 1403is further configured to determine m based on the first jitter jitter,where m is a quantity of label numbers used to identify the periods ofthe first network device, and the first jitter is the jitter of thefirst network device.

The receiving unit 1402 is further configured to receive secondinformation sent by the second network device, where the secondinformation indicates n, n is a quantity of label numbers used toidentify the periods of the second network device, and m and n arepositive integers.

The processing unit 1403 numbers each period of the first network devicebased on m and n.

Optionally, that the processing unit 1403 numbers each period of thefirst network device based on m and n includes:

the processing unit 1403 calculates a least common multiple L of m andn;

the processing unit 1403 determines, based on L and m, a quantity x ofgroups into which the periods of the first network device can bedivided; and

the processing unit 1403 numbers each period of the first network devicebased on m and x, where the number of each period of the first networkdevice includes a label number and a group number.

Specifically, the quantity of groups is x=L/m, and each group in the xgroups of periods includes m periods.

Optionally, the sending unit 1401 is configured to send thirdinformation to the second network device, where the third informationindicates m, and m is used to support the second network device innumbering each period of the second network device.

Specifically, that the first information carries the first numberincludes:

p bits of the first information are used to indicate a value of thefirst label number; and

q bits of the first information are used to indicate a value of thefirst group number, where p and q are positive integers.

It should be understood that the processing unit 1403 in this embodimentof this application may be implemented by a processor or aprocessor-related circuit component, and the sending unit 1402 and thereceiving unit 1401 may be implemented by a transceiver or atransceiver-related circuit component.

FIG. 15 is a schematic block diagram of a second network device 1500according to an embodiment of this application. The second networkdevice includes a receiving unit 1501, a sending unit 1502, and aprocessing unit 1503.

The processing unit 1503 is configured to determine a first number,where the first number is a number of the 1^(st) period of the secondnetwork device, and the first number includes a first label number and afirst group number.

The sending unit 1502 is configured to send first information to a firstnetwork device, where the first information carries the first number,and the first information is used to support the first network device inestablishing mapping relationships between numbers of a plurality ofperiods of the first network device and numbers of a plurality ofperiods of the second network device.

Optionally, that the processing unit 1503 determines the first numberincludes:

the processing unit 1503 determines n based on a second jitter jitter,where n is a quantity of label numbers used to identify the periods ofthe second network device, and the second jitter is a jitter of thesecond network device;

the second network device further includes:

a receiving unit 1501, configured to receive third information sent bythe first network device, where the third information indicates m, m isa quantity of label numbers used to identify the periods of the firstnetwork device, and m and n are positive integers; and

the processing unit 1503 numbers each period of the second networkdevice based on m and n, and determines the first number.

Specifically, that the processing unit 1503 numbers each period of thesecond network device based on m and n includes:

the processing unit 1503 calculates a least common multiple L of m andn;

the processing unit 1503 determines, based on L and n, a quantity y ofgroups into which the periods of the second network device can bedivided; and

the processing unit 1503 numbers each period of the second networkdevice based on n and y, where the number of each period of the secondnetwork device includes a label number and a group number.

Specifically, the quantity of groups is y=L/n, and each group in the ygroups of periods includes n periods.

The sending unit 1502 is further configured to send second informationto the first network device, where the second information indicates n,and n is used to support the first network device in numbering eachperiod of the first network device.

Specifically, that the first information carries the first numberincludes:

p bits of the first information are used to indicate a value of thefirst label number; and

q bits of the first information are used to indicate a value of thefirst group number, where p and q are positive integers.

It should be understood that the processing unit 1503 in this embodimentof this application may be implemented by a processor or aprocessor-related circuit component, and the sending unit 1502 and thereceiving unit 1501 may be implemented by a transceiver or atransceiver-related circuit component.

As shown in FIG. 16 , an embodiment of this application further providesa first network device 1600. The first network device 1600 includes aprocessor 1601, a memory 1602, and a transceiver 1603. The memory 1602stores an instruction or a program, and the processor 1603 is configuredto execute the instruction or the program stored in the memory 1602.When the instruction or the program stored in the memory 1602 isexecuted, the processor 1601 is configured to perform an operationperformed by the processing unit 1403 in the embodiment shown in FIG. 14, and the transceiver 1603 is configured to perform operations performedby the receiving unit 1402 and the sending unit 1401 in the embodimentshown in FIG. 14 .

As shown in FIG. 17 , an embodiment of this application further providesa second network device 1700. The second network device 1700 includes aprocessor 1701, a memory 1702, and a transceiver 1703. The memory 1702stores an instruction or a program, and the processor 1703 is configuredto execute the instruction or the program stored in the memory 1702.When the instruction or the program stored in the memory 1702 isexecuted, the processor 1701 is configured to perform an operationperformed by the processing unit 1503 in the embodiment shown in FIG. 15, and the transceiver 1703 is configured to perform operations performedby the receiving unit 1502 and the sending unit 1501 in the embodimentshown in FIG. 15 .

Still another aspect of this application provides a computer readablestorage medium. The computer readable storage medium stores aninstruction, and when the instruction is run on a computer, the computeris enabled to perform steps performed by the first network device in themethods in FIG. 6 to FIG. 13 .

Still another aspect of this application provides a computer readablestorage medium. The computer readable storage medium stores aninstruction, and when the instruction is run on a computer, the computeris enabled to perform steps performed by the second network device inthe methods in FIG. 6 to FIG. 13 .

Still another aspect of this application provides a computer programproduct including an instruction. When the computer program product isrun on a computer, the computer is enabled to perform steps performed bythe first network device in the methods in FIG. 6 to FIG. 13 .

Still another aspect of this application provides a computer programproduct including an instruction. When the computer program product isrun on a computer, the computer is enabled to perform steps performed bythe second network device in the methods in FIG. 6 to FIG. 13 .

Still another aspect of this application provides a chip system. Thesystem includes a processor, an input pin, an output pin, and the like.The processor performs steps performed by the first network device inthe methods in FIG. 6 to FIG. 13 .

Still another aspect of this application provides a chip system. Thesystem includes a processor, an input pin, an output pin, and the like.The processor performs steps performed by the second network device inthe methods in FIG. 6 to FIG. 13 .

It should be understood that, the processor mentioned in the embodimentsof the present disclosure may be a central processing unit (centralprocessing unit, CPU), the processor may further be another generalpurpose processor, a digital signal processor (digital signal processor,DSP), an application specific integrated circuit (application specificintegrated circuit, ASIC), a field programmable gate array (fieldprogrammable gate array, FPGA), or another programmable logical device,discrete gate or transistor logical device, discrete hardware component,or the like. The general purpose processor may be a microprocessor, orthe processor may be any conventional processor or the like.

It may be understood that the memory mentioned in the embodiments of thepresent disclosure may be a volatile memory or a nonvolatile memory, ormay include a volatile memory and a nonvolatile memory. The nonvolatilememory may be a read-only memory (read-only memory, ROM), a programmableread-only memory (programmable ROM, PROM), an erasable programmableread-only memory (erasable PROM, EPROM), an electrically erasableprogrammable read-only memory (electrically EPROM, EEPROM), or a flashmemory. The volatile memory may be a random access memory (random accessmemory, RAM), used as an external cache. Through example but notlimitative description, many forms of RAMs may be used, for example, astatic random access memory (static RAM, SRAM), a dynamic random accessmemory (dynamic RAM, DRAM), a synchronous dynamic random access memory(synchronous DRAM, SDRAM), a double data rate synchronous dynamic randomaccess memory (double data rate SDRAM, DDR SDRAM), an enhancedsynchronous dynamic random access memory (enhanced SDRAM, ESDRAM), asynchronous link dynamic random access memory (synchlink DRAM, SLDRAM),and a direct rambus dynamic random access memory (direct rambus RAM, DRRAM).

It should be noted that when the processor is a universal processor, aDSP, an ASIC, an FPGA or another programmable logic device, a discretegate or a transistor logic device, or a discrete hardware component, thememory (the storage module) is integrated into the processor.

It should be noted that the memory described in this specificationincludes but is not limited to these and any memory of another propertype.

A person of ordinary skill in the art may be aware that, in combinationwith the examples described in the embodiments disclosed in thisspecification, units and algorithm steps may be implemented byelectronic hardware or a combination of computer software and electronichardware. Whether the functions are performed by hardware or softwaredepends on particular applications and design constraint conditions ofthe technical solutions. A person skilled in the art may use differentmethods to implement the described functions for each particularapplication, but it should not be considered that the implementationgoes beyond the scope of this application.

It may be clearly understood by a person skilled in the art that, forthe purpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, refer to acorresponding process in the foregoing method embodiments, and detailsare not described herein again.

In the several embodiments provided in this application, it should beunderstood that the disclosed system, apparatus, and method may beimplemented in other manners. For example, the described apparatusembodiment is merely an example. For example, the unit division ismerely logical function division and may be other division in actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beimplemented by using some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electronic, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all of the units may be selected based on actualrequirements to achieve the objectives of the solutions of theembodiments.

In addition, functional units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units are integrated into one unit.

When the functions are implemented in the form of a software functionalunit and sold or used as an independent product, the functions may bestored in a computer-readable storage medium. Based on such anunderstanding, the technical solutions of this application essentially,or the part contributing to the prior art, or some of the technicalsolutions may be implemented in a form of a software product. Thecomputer software product is stored in a storage medium, and includesseveral instructions for instructing a computer device (which may be apersonal computer, a server, or a network device) to perform all or someof the steps of the methods described in the embodiments of thisapplication. The foregoing storage medium includes: any medium that canstore program code, such as a USB flash drive, a removable hard disk, aread-only memory (read-only memory, ROM), a random access memory (randomaccess memory, RAM), a magnetic disk, or an optical disc.

The foregoing descriptions are merely specific implementations of thisapplication, but are not intended to limit the protection scope of thisapplication. Any variation or replacement readily figured out by aperson skilled in the art within the technical scope disclosed in thisapplication shall fall within the protection scope of this application.Therefore, the protection scope of this application shall be subject tothe protection scope of the claims.

What is claimed is:
 1. A period mapping method, comprising: determining,by a first network device, m based on a first jitter, wherein m is aquantity of label numbers used to identify a plurality of periods of thefirst network device, and the first jitter is a jitter of the firstnetwork device; receiving, by the first network device, secondinformation sent by a second network device, wherein the secondinformation indicates n, n is a quantity of label numbers used toidentify a plurality of periods of the second network device, and m andn are positive integers; numbering, by the first network device, eachperiod of the first network device based on m and n; after thenumbering, receiving, by the first network device, first informationsent by the second network device, wherein the first information carriesa first number, the first number is a number of a first period of thesecond network device, and the first number comprises a first labelnumber and a first group number; determining, by the first networkdevice, the first period that can be used to send the first information,wherein a second number of the first period comprises a second labelnumber and a second group number, the first label number and the firstgroup number meet a mapping relationship with the second label numberand the second group number; and establishing, by the first networkdevice, mapping relationships between numbers of the plurality ofperiods of the first network device and numbers of the plurality ofperiods of the second network device based on the mapping relationship.2. The method according to claim 1, wherein the determining, by thefirst network device, the first period that can be used to send thefirst information comprises: determining, by the first network devicebased on a first moment and the first jitter, the first period that canbe used to send the first information, wherein the first moment is amoment at which the first network device receives the first information.3. The method according to claim 1, wherein that the first informationcarries the first number comprises: p bits of the first information areused to indicate a value of the first label number; and q bits of thefirst information are used to indicate a value of the first groupnumber, wherein p and q are positive integers.
 4. The method accordingto claim 1, wherein the numbering, by the first network device, eachperiod of the first network device based on m and n comprises:calculating, by the first network device, a least common multiple L of mand n; determining, by the first network device based on L and m, aquantity x of groups into which the periods of the first network devicecan be divided; and numbering, by the first network device, each periodof the first network device based on m and x, wherein the number of eachperiod of the first network device comprises a label number and a groupnumber.
 5. The method according to claim 4, wherein the quantity ofgroups is x=L/m, and each group in the x groups of periods comprises mperiods.
 6. The method according to claim 1, wherein the method furthercomprises: sending, by the first network device, third information tothe second network device, wherein the third information indicates m,and m is used to support the second network device in numbering eachperiod of the second network device.
 7. A period mapping method,comprising: determining, by a second network device, n based on a secondjitter, wherein n is a quantity of label numbers used to identify aplurality of periods of the second network device, and the second jitteris a jitter of the second network device; receiving, by the secondnetwork device, third information sent by a first network device,wherein the third information indicates m, m is a quantity of labelnumbers used to identify a plurality of periods of the first networkdevice, and m and n are positive integers; and numbering, by the secondnetwork device, each period of the second network device based on m andn; determining, by the second network device, a first number, whereinthe first number is a number of a first period of the second networkdevice, and the first number comprises a first label number and a firstgroup number; and sending, by the second network device, firstinformation to the first network device, wherein the first informationcarries the first number, and the first information is used to supportthe first network device in establishing mapping relationships betweennumbers of the plurality of periods of the first network device andnumbers of the plurality of periods of the second network device.
 8. Themethod according to claim 7, wherein the method further comprises:sending, by the second network device, second information to the firstnetwork device, wherein the second information indicates n, and n isused to support the first network device in numbering each period of thefirst network device.
 9. The method according to claim 7, wherein thatthe first information carries the first number comprises: p bits of thefirst information are used to indicate a value of the first labelnumber; and q bits of the first information are used to indicate a valueof the first group number, wherein p and q are positive integers. 10.The method according to claim 7, wherein the numbering, by the secondnetwork device, each period of the second network device based on m andn comprises: calculating, by the second network device, a least commonmultiple L of m and n; determining, by the second network device basedon L and n, a quantity y of groups into which the periods of the secondnetwork device can be divided; and numbering, by the second networkdevice, each period of the second network device based on n and y,wherein the number of each period of the second network device comprisesa label number and a group number.
 11. The method according to claim 10,wherein the quantity of groups is y=L/n, and each group in the y groupsof periods comprises n periods.
 12. A first network device, comprising:a receiver, configured to receive first information sent by a secondnetwork device, wherein the first information carries a first number,the first number is a number of a first period of the second networkdevice, and the first number comprises a first label number and a firstgroup number; and a processor and a memory comprising instructions,wherein when executing the instructions the processor is configured todetermine the first period that can be used to send the firstinformation, wherein a second number of the first period comprises asecond label number and a second group number, the first label numberand the first group number meet a mapping relationship with the secondlabel number and the second group number, wherein when executing theinstructions the processor is further configured to establish mappingrelationships between numbers of a plurality of periods of the firstnetwork device and numbers of a plurality of periods of the secondnetwork device based on the mapping relationship, before the receiverreceives the first information sent by the second network device, whenexecuting the instructions the processor is further configured todetermine m based on the first jitter, wherein m is a quantity of labelnumbers used to identify the periods of the first network device, andthe first jitter is a jitter of the first network device, the receiveris further configured to receive second information sent by the secondnetwork device, wherein the second information indicates n, n is aquantity of label numbers used to identify the periods of the secondnetwork device, and m and n are positive integers; and when executingthe instructions the processor is configured to number each period ofthe first network device based on m and n.
 13. The first network deviceaccording to claim 12, wherein the first network device furthercomprises: a sending unit, configured to send third information to thesecond network device, wherein the third information indicates m, and mis used to support the second network device in numbering each period ofthe second network device.
 14. The first network device according toclaim 12, wherein that the first information carries the first numbercomprises: p bits of the first information are used to indicate a valueof the first label number; and q bits of the first information are usedto indicate a value of the first group number, wherein p and q arepositive integers.
 15. The first network device according to claim 12,wherein that the processor is configured to determine the first periodthat can be used to send the first information comprises: the processoris configured to determine, based on a first moment and the firstjitter, the first period that can be used to send the first information,wherein the first moment is a moment at which the first network devicereceives the first information.
 16. The first network device accordingto claim 12, wherein that the processor is configured to number eachperiod of the first network device based on m and n comprises: theprocessor is configured to calculate a least common multiple L of m andn; the processor is configured to determine, based on L and m, aquantity x of groups into which the periods of the first network devicecan be divided; and the processor is configured to number each period ofthe first network device based on m and x, wherein the number of eachperiod of the first network device comprises a label number and a groupnumber.
 17. The first network device according to claim 16, wherein thequantity of groups is x=L/m, and each group in the x groups of periodscomprises m periods.